<?php
/**
 * Created by PhpStorm.
 * User: Da Xiong
 * Date: 2018/12/5
 * Time: 10:00
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class MallOrders extends Model
{
    protected $table = 'mall_orders';

    //0订单删除1未付款2成功付款
    const STATUS_0 = 0;//已删除
    const STATUS_1 = 1;//待发货
    const STATUS_2 = 2;//已发货

    const STATUS_TEXT = [
        self::STATUS_0 => '<span class="el-tag el-tag--danger">删除</span>',
        self::STATUS_1 => '<span class="el-tag el-tag--info">待发货</span>',
        self::STATUS_2=> '<span class="el-tag">已发货</span>',
    ];

    protected $fillable = [
        'oid','user_id','mall_id','score','address_id','number','user_name','user_address','user_phone','status','created_at','updated_at'
    ];
//    public $timestamps = false;
    protected $dates = ['created_at','updated_at'];

    public function shop(){
        return $this->belongsTo('App\Models\Mall', 'mall_id', 'id');
    }
}